<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js" type="text/javascript"></script>
</head>

<body>
    <div id="app">
        {{message}}
    </div>
    <div id="app-2">
        <span v-bind:title="message">
          鼠标悬停几秒钟查看此处动态绑定的提示信息！
        </span>
    </div>
    <div id="app-3">
        <p v-if="seen">visible</p>
    </div>
    <div id="app-4">
        <ol>
            <li v-for="todo in todos">
                {{todo.text}}
            </li>
        </ol>
    </div>
    <div id="app-5">
        <p> {{message}} </p>
        <button onclick="reverseMessage">reverseMessage</button>
    </div>
<!-- script -->
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                message: 'hello w'
            }
        });
        var app2 = new Vue({
            el: '#app-2',
            data: {
                message: '页面加载于 ' + new Date().toLocaleString()
            }
        });
        var app3 = new Vue({
            el: '#app-3',
            data: {
                seen: true
            }
        });
        var app4 = new Vue({
            el: '#app-4',
            data: {
                todos: [
                    {text: 'study js'},
                    {text: 'study vue'},
                    {text: 'all'}
                ]
            }
        });
        var app5 = new Vue({
            el: '#app-5',
            data: {
                message: 'hello vue'
            },
            methods:{
                reverseMessage:function(){
                    this.message = this.message.split('').reverse().join('')
                }
            }
        })
    </script>
</body>

</html>